<?php

 class Promocion_model extends CI_Model {
   
    function __construct(){   
        parent::__construct();
        $this->config->load('database_tables');
        $this->_table = $this->config->item('dbtables');
    }
	
    function getPromociones($selects = null, $wheres = null, $limit = null, $activo = null){
        if($selects != null){
            $this->db->select(implode(",", $selects));
        }
        if($wheres != null){
            $this->db->where('id', $wheres);
        }
        if($activo != null){
            $this->db->where('activo', $activo);
        }
        if($limit != null){
            $this->db->limit($limit, 0);
        }
        return $this->db->get($this->_table['promocion']);
    }
}